php forum
php mysql forum
php mysql smarty
 
Topic Options
#274846 - 06/11/04 02:37 AM Finished-[6.4] Post Image Limit v1.0.0
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia
Mod Name / Version: Post Image Limit v1.0.0<br /><br />Description: This trivial mod allows you to control number of images users put in their posts. All images are counted: graemlins, image code tags and html <img src> tag. <br /><br />Working Under: UBB.Threads 6.4 <br /><br />Mod Status: Finished <br /><br />Any pre-requisites: None. <br /><br />Author(s): PaNTerSan <br /><br />Date: 06/11/04 <br /><br />Credits: Astaran for guidance <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> <br /><br />Files Altered: config.inc.php, ubbt.inc.php <br /><br />New Files: None. <br /><br />Database Altered: NO <br /><br />Info/Instructions: See below.<br /> <br /><br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files. <br /><br />My notes:<br />[*]When using my instructions, use some board that supports ubbCode and make copy&paste instructions to a post - then use magic: preview <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br /><br /><br />Feature suggestions & improvements:<br />[*]None.<br /><br /><br /><br />History<br /> 2004.06.11 PaNTerSan - 1.0.0 Original coding started<br /><br /><br /><br />Installation Steps<br /><br /><br />______________________________________________________________________________<br />[:"purple"] Code changes [/] <br /><br />[*][:"green"] File[/]<br />config.inc.php<br /><br />[:"red"]At the end add[/]<br />
Code:
<br />$config['maxImages'] = '5';     // maximum number of immages in a post<br />
<br />Set value to your desires <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />[*][:"green"] File[/]<br />ubbt.inc.php<br /><br />[:"blue"]Find in do_markup[/] <br />
Code:
<br />                $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i", "&lt;img src=\"http\\2.\\3\"&gt;", $Body);              <br />
<br /> <br />[:"red"]Replace with[/]<br />
Code:
<br />                $Body = preg_replace("/(\[IMG\]|\[{$ubbt_lang['TEXT_IMAGE']}\])http([^\[]*)\.(gif|jpg|png)(\[\/IMG\]|\[\/{$ubbt_lang['TEXT_IMAGE']}\])/i", "&lt;img src=\"http\\2.\\3\"&gt;", $Body);              <br />                <br />                $images = preg_match_all("/img src/", $Body, $out, PREG_SET_ORDER);<br />                if ( $config['maxImages'] &lt; $images ){<br />                    $msg = "You can only have {$config['maxImages']} images in your post";<br />                    $this-&gt;not_right($msg, $Cat);<br />                }<br />
<br />Note: I am also using Astaran's signature restriction <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" /><br /><br />[*]End Code changes


Attachments
114993-Post Image Limit v1.0.0.zip (5 downloads)


Top
#274847 - 06/11/04 03:14 AM Re: Finished-[6.4] Post Image Limit v1.0.0 [Re: Brandon Long]
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia
_________________________
Kind regards,
PaNTerSan

Top



Moderator:  Ian_W 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks